package com.xiaochun.jiankangapp.fragment

import android.os.Bundle
import android.view.View
import com.xiaochun.jiankangapp.base.CViewBinding
import com.xiaochun.jiankangapp.databinding.FragmentInputInfoStep2Binding
import com.xiaochun.jiankangapp.extension.onClick

class InputInfoStep2Fragment : InputInfoBaseFragment() {

    @CViewBinding
    lateinit var viewBinding: FragmentInputInfoStep2Binding
    override fun initView(root: View, savedInstanceState: Bundle?) {
        super.initView(root, savedInstanceState)
        viewBinding.date.setOnDateSelectedListener { year, month, day ->
            inputViewModel.year = year
            inputViewModel.month = month
            inputViewModel.day = day
        }
        viewBinding.next.onClick {
            if (inputViewModel.year == 0) {
                return@onClick
            }
            replaceNext(InputInfoStep3Fragment::class.java)
        }
    }
}